home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 539 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
10% dexvert Text File (text/txt) fallback Supported
100% file Non-ISO extended-ASCII text default (weak)
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 70 6c 61 74 69 6e 75 6d | 2e 63 6f 6d 21 6e 6f 62 |platinum|.com!nob|
|00000030| 6f 64 79 0a 46 72 6f 6d | 3a 20 52 75 64 20 4d 65 |ody.From|: Rud Me|
|00000040| 72 72 69 61 6d 20 3c 72 | 6d 65 72 72 69 61 6d 40 |rriam <r|merriam@|
|00000050| 73 6f 66 74 69 6e 74 2e | 63 6f 6d 3e 0a 53 75 62 |softint.|com>.Sub|
|00000060| 6a 65 63 74 3a 20 52 65 | 3a 20 62 65 67 69 6e 6e |ject: Re|: beginn|
|00000070| 65 72 20 71 75 65 73 74 | 69 6f 6e 20 2d 20 63 6f |er quest|ion - co|
|00000080| 6e 73 74 61 6e 74 73 0a | 4d 65 73 73 61 67 65 2d |nstants.|Message-|
|00000090| 49 44 3a 20 3c 33 30 45 | 41 46 44 37 45 2e 31 39 |ID: <30E|AFD7E.19|
|000000a0| 44 31 40 73 6f 66 74 69 | 6e 74 2e 63 6f 6d 3e 0a |D1@softi|nt.com>.|
|000000b0| 53 65 6e 64 65 72 3a 20 | 6e 6f 62 6f 64 79 40 67 |Sender: |nobody@g|
|000000c0| 61 74 65 77 61 79 2e 70 | 6c 61 74 69 6e 75 6d 2e |ateway.p|latinum.|
|000000d0| 63 6f 6d 0a 4d 69 6d 65 | 2d 56 65 72 73 69 6f 6e |com.Mime|-Version|
|000000e0| 3a 20 31 2e 30 0a 58 2d | 4d 61 69 6c 65 72 3a 20 |: 1.0.X-|Mailer: |
|000000f0| 4d 6f 7a 69 6c 6c 61 20 | 32 2e 30 62 33 20 28 57 |Mozilla |2.0b3 (W|
|00000100| 69 6e 4e 54 3b 20 49 29 | 0a 43 6f 6e 74 65 6e 74 |inNT; I)|.Content|
|00000110| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|00000120| 6e 3b 20 63 68 61 72 73 | 65 74 3d 69 73 6f 2d 38 |n; chars|et=iso-8|
|00000130| 38 35 39 2d 31 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |859-1.Or|ganizati|
|00000140| 6f 6e 3a 20 50 6c 61 74 | 69 6e 75 6d 20 74 65 63 |on: Plat|inum tec|
|00000150| 68 6e 6f 6c 6f 67 79 20 | 69 6e 63 2e 20 5c 20 53 |hnology |inc. \ S|
|00000160| 6f 66 74 77 61 72 65 20 | 49 6e 74 65 72 66 61 63 |oftware |Interfac|
|00000170| 65 73 0a 44 61 74 65 3a | 20 57 65 64 2c 20 33 20 |es.Date:| Wed, 3 |
|00000180| 4a 61 6e 20 31 39 39 36 | 20 32 32 3a 30 34 3a 34 |Jan 1996| 22:04:4|
|00000190| 36 20 47 4d 54 0a 52 65 | 66 65 72 65 6e 63 65 73 |6 GMT.Re|ferences|
|000001a0| 3a 20 3c 34 63 65 68 74 | 30 24 72 75 6a 40 73 75 |: <4ceht|0$ruj@su|
|000001b0| 6e 2e 63 69 73 2e 73 6d | 75 2e 65 64 75 3e 0a 54 |n.cis.sm|u.edu>.T|
|000001c0| 6f 3a 20 64 62 6f 77 6d | 61 6e 40 70 6f 73 74 2e |o: dbowm|an@post.|
|000001d0| 73 6d 75 2e 65 64 75 0a | 43 6f 6e 74 65 6e 74 2d |smu.edu.|Content-|
|000001e0| 54 72 61 6e 73 66 65 72 | 2d 45 6e 63 6f 64 69 6e |Transfer|-Encodin|
|000001f0| 67 3a 20 38 62 69 74 0a | 0a 44 61 6d 6f 6e 20 42 |g: 8bit.|.Damon B|
|00000200| 6f 77 6d 61 6e 20 77 72 | 6f 74 65 3a 0a 3e 20 0a |owman wr|ote:.> .|
|00000210| 3e 20 43 61 6e 20 61 6e | 79 6f 6e 65 20 65 78 70 |> Can an|yone exp|
|00000220| 6c 61 69 6e 20 74 6f 20 | 6d 65 20 74 68 65 20 66 |lain to |me the f|
|00000230| 75 6e 63 74 69 6f 6e 61 | 6c 20 64 69 66 66 65 72 |unctiona|l differ|
|00000240| 65 6e 63 65 20 62 65 74 | 77 65 65 6e 20 61 0a 3e |ence bet|ween a.>|
|00000250| 20 6d 61 63 72 6f 2d 62 | 61 73 65 64 20 63 6f 6e | macro-b|ased con|
|00000260| 73 74 61 6e 74 20 61 6e | 64 20 61 20 66 6f 72 6d |stant an|d a form|
|00000270| 61 6c 20 63 6f 6e 73 74 | 61 6e 74 3f 20 20 49 20 |al const|ant? I |
|00000280| 75 6e 64 65 72 73 74 61 | 6e 64 20 74 68 61 74 20 |understa|nd that |
|00000290| 62 79 0a 3e 20 75 73 69 | 6e 67 20 74 68 65 20 23 |by.> usi|ng the #|
|000002a0| 64 65 66 69 6e 65 20 64 | 69 72 65 63 74 69 76 65 |define d|irective|
|000002b0| 2c 20 74 68 65 20 70 72 | 65 70 72 6f 63 65 73 73 |, the pr|eprocess|
|000002c0| 6f 72 20 72 65 70 6c 61 | 63 65 73 20 61 6c 6c 20 |or repla|ces all |
|000002d0| 69 6e 73 74 61 6e 63 65 | 73 0a 3e 20 6f 66 20 74 |instance|s.> of t|
|000002e0| 68 65 20 63 6f 6e 73 74 | 61 6e 74 20 69 6e 20 74 |he const|ant in t|
|000002f0| 68 65 20 63 6f 64 65 20 | 77 69 74 68 20 69 74 92 |he code |with it.|
|00000300| 73 20 76 61 6c 75 65 2e | 20 20 49 20 61 6c 73 6f |s value.| I also|
|00000310| 20 75 6e 64 65 72 73 74 | 61 6e 64 20 74 68 61 74 | underst|and that|
|00000320| 0a 3e 20 66 6f 72 6d 61 | 6c 20 63 6f 6e 73 74 61 |.> forma|l consta|
|00000330| 6e 74 73 20 28 75 73 69 | 6e 67 20 74 68 65 20 63 |nts (usi|ng the c|
|00000340| 6f 6e 73 74 20 6b 65 79 | 77 6f 72 64 29 20 64 6f |onst key|word) do|
|00000350| 20 6e 6f 74 20 75 6e 64 | 65 72 67 6f 20 74 68 69 | not und|ergo thi|
|00000360| 73 0a 3e 20 72 65 70 6c | 61 63 65 6d 65 6e 74 2e |s.> repl|acement.|
|00000370| 0a 0a 41 20 66 6f 72 6d | 61 6c 20 63 6f 6e 73 74 |..A form|al const|
|00000380| 61 6e 74 20 6d 61 79 20 | 6f 72 20 6d 61 79 20 6e |ant may |or may n|
|00000390| 6f 74 20 62 65 20 72 65 | 70 6c 61 63 65 64 20 61 |ot be re|placed a|
|000003a0| 74 20 74 68 65 20 64 69 | 73 63 72 65 74 69 6f 6e |t the di|scretion|
|000003b0| 20 6f 66 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 | of the |compiler|
|000003c0| 2e 20 0a 49 74 20 63 61 | 6e 20 75 73 65 20 74 68 |. .It ca|n use th|
|000003d0| 65 20 6c 69 74 65 72 61 | 6c 20 76 61 6c 75 65 20 |e litera|l value |
|000003e0| 6f 72 20 74 68 65 20 63 | 6f 6e 73 74 20 76 61 72 |or the c|onst var|
|000003f0| 69 61 62 6c 65 20 61 73 | 20 61 70 70 72 6f 70 72 |iable as| appropr|
|00000400| 69 61 74 65 2e 20 54 68 | 65 20 74 79 70 69 63 61 |iate. Th|e typica|
|00000410| 6c 20 0a 70 6c 61 63 65 | 20 77 68 65 72 65 20 74 |l .place| where t|
|00000420| 68 69 73 20 64 69 66 66 | 65 72 65 6e 63 65 20 61 |his diff|erence a|
|00000430| 70 70 65 61 72 73 20 69 | 73 20 69 6e 20 70 61 73 |ppears i|s in pas|
|00000440| 73 69 6e 67 20 61 20 63 | 6f 6e 73 74 20 74 6f 20 |sing a c|onst to |
|00000450| 61 20 66 75 6e 63 74 69 | 6f 6e 2e 20 41 73 20 61 |a functi|on. As a|
|00000460| 20 0a 72 65 66 65 72 65 | 6e 63 65 20 28 63 6f 6e | .refere|nce (con|
|00000470| 73 74 20 69 6e 74 26 29 | 20 79 6f 75 20 67 65 74 |st int&)| you get|
|00000480| 20 74 68 65 20 76 61 72 | 69 61 62 6c 65 3b 20 62 | the var|iable; b|
|00000490| 79 20 76 61 6c 75 65 20 | 28 63 6f 6e 73 74 20 69 |y value |(const i|
|000004a0| 6e 74 29 20 79 6f 75 20 | 6d 61 79 20 67 65 74 20 |nt) you |may get |
|000004b0| 0a 74 68 65 20 76 61 6c | 75 65 2e 0a 0a 3e 20 0a |.the val|ue...> .|
|000004c0| 3e 20 57 68 61 74 20 49 | 20 64 6f 6e 92 74 20 75 |> What I| don.t u|
|000004d0| 6e 64 65 72 73 74 61 6e | 64 20 69 73 20 77 68 79 |nderstan|d is why|
|000004e0| 20 6f 6e 65 20 6d 69 67 | 68 74 20 62 65 20 62 65 | one mig|ht be be|
|000004f0| 74 74 65 72 20 74 68 61 | 6e 20 61 6e 6f 74 68 65 |tter tha|n anothe|
|00000500| 72 20 61 6e 64 0a 3e 20 | 77 68 61 74 20 63 6f 6e |r and.> |what con|
|00000510| 64 69 74 69 6f 6e 73 20 | 6d 69 67 68 74 20 69 6e |ditions |might in|
|00000520| 66 6c 75 65 6e 63 65 20 | 6d 65 20 74 6f 20 63 68 |fluence |me to ch|
|00000530| 6f 6f 73 65 20 6f 6e 65 | 20 6f 76 65 72 20 74 68 |oose one| over th|
|00000540| 65 20 6f 74 68 65 72 2e | 20 20 54 68 65 79 0a 3e |e other.| They.>|
|00000550| 20 61 70 70 65 61 72 20 | 74 6f 20 62 65 20 74 77 | appear |to be tw|
|00000560| 6f 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 74 68 |o versio|ns of th|
|00000570| 65 20 73 61 6d 65 20 74 | 68 69 6e 67 2e 0a 3e 20 |e same t|hing..> |
|00000580| 0a 0a 54 68 65 20 63 6f | 6d 70 69 6c 65 72 20 64 |..The co|mpiler d|
|00000590| 6f 65 73 6e 27 74 20 73 | 65 65 20 61 20 23 64 65 |oesn't s|ee a #de|
|000005a0| 66 69 6e 65 20 61 73 20 | 63 6f 6e 73 74 61 6e 74 |fine as |constant|
|000005b0| 20 73 6f 20 67 69 76 65 | 6e 20 66 28 63 6f 6e 73 | so give|n f(cons|
|000005c0| 74 20 69 6e 74 26 29 20 | 61 6e 64 20 0a 66 28 69 |t int&) |and .f(i|
|000005d0| 6e 74 26 29 20 74 68 65 | 20 6c 61 74 74 65 72 20 |nt&) the| latter |
|000005e0| 69 73 20 74 68 65 20 63 | 68 6f 69 63 65 20 6f 66 |is the c|hoice of|
|000005f0| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 2e 20 4e | the com|piler. N|
|00000600| 6f 74 20 77 68 61 74 20 | 6d 6f 73 74 20 64 65 76 |ot what |most dev|
|00000610| 65 6c 6f 70 65 72 73 20 | 77 6f 75 6c 64 20 0a 65 |elopers |would .e|
|00000620| 78 70 65 63 74 2e 0a 0a | 3e 20 49 73 20 69 74 20 |xpect...|> Is it |
|00000630| 61 20 73 70 65 65 64 20 | 69 73 73 75 65 3f 20 20 |a speed |issue? |
|00000640| 49 6e 74 75 69 74 69 76 | 65 6c 79 2c 20 74 68 65 |Intuitiv|ely, the|
|00000650| 20 6d 61 63 72 6f 2d 62 | 61 73 65 64 20 63 6f 6e | macro-b|ased con|
|00000660| 73 74 61 6e 74 20 73 65 | 65 6d 73 20 6c 69 6b 65 |stant se|ems like|
|00000670| 0a 3e 20 69 74 20 77 6f | 75 6c 64 20 70 72 6f 63 |.> it wo|uld proc|
|00000680| 65 73 73 20 66 61 73 74 | 65 72 2e 20 20 57 68 61 |ess fast|er. Wha|
|00000690| 74 92 73 20 74 68 65 20 | 74 72 61 64 65 6f 66 66 |t.s the |tradeoff|
|000006a0| 3f 0a 0a 41 74 20 6d 6f | 73 74 20 79 6f 75 72 20 |?..At mo|st your |
|000006b0| 67 6f 69 6e 67 20 74 6f | 20 73 65 65 20 61 20 6d |going to| see a m|
|000006c0| 65 6d 6f 72 79 20 61 63 | 63 65 73 73 20 73 6f 6d |emory ac|cess som|
|000006d0| 65 74 69 6d 65 73 20 73 | 6f 20 74 68 65 20 73 70 |etimes s|o the sp|
|000006e0| 65 65 64 20 69 73 73 75 | 65 20 69 73 20 0a 74 72 |eed issu|e is .tr|
|000006f0| 69 76 69 61 6c 2e 20 0a | 0a 2d 2d 20 0a 52 75 64 |ivial. .|.-- .Rud|
|00000700| 20 4d 65 72 72 69 61 6d | 20 20 20 20 20 20 20 20 | Merriam| |
|00000710| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000720| 20 20 76 6f 69 63 65 3a | 28 37 31 33 29 20 34 39 | voice:|(713) 49|
|00000730| 32 2d 30 37 30 37 20 78 | 31 31 38 0a 50 4c 41 54 |2-0707 x|118.PLAT|
|00000740| 49 4e 55 4d 20 74 65 63 | 68 6e 6f 6c 6f 67 79 2c |INUM tec|hnology,|
|00000750| 20 49 6e 63 2e 20 20 20 | 20 20 20 20 20 20 20 20 | Inc. | |
|00000760| 20 66 61 78 3a 20 20 28 | 37 31 33 29 20 34 39 32 | fax: (|713) 492|
|00000770| 2d 30 37 32 35 0a 53 6f | 66 74 77 61 72 65 20 49 |-0725.So|ftware I|
|00000780| 6e 74 65 72 66 61 63 65 | 73 20 4c 61 62 20 20 20 |nterface|s Lab |
|00000790| 20 20 20 20 20 20 20 20 | 20 20 20 6d 65 72 72 69 | | merri|
|000007a0| 61 6d 40 70 6c 61 74 69 | 6e 75 6d 2e 63 6f 6d 0a |am@plati|num.com.|
|000007b0| 31 34 30 30 20 42 72 6f | 61 64 66 69 65 6c 64 2c |1400 Bro|adfield,|
|000007c0| 20 53 75 69 74 65 20 36 | 30 30 2c 20 20 20 20 20 | Suite 6|00, |
|000007d0| 20 20 20 20 20 43 49 53 | 3a 20 37 34 34 33 31 2c | CIS|: 74431,|
|000007e0| 31 36 32 30 0a 48 6f 75 | 73 74 6f 6e 2c 20 54 58 |1620.Hou|ston, TX|
|000007f0| 20 37 37 30 38 34 0a | | 77084. | |
+--------+-------------------------+-------------------------+--------+--------+